﻿using System;
using System.Runtime.InteropServices;

namespace WebAnalyser.UI
{
    internal enum TBPFLAG
    {
        TBPF_NOPROGRESS = 0x00000000,
        TBPF_INDETERMINATE = 0x00000001,
        TBPF_NORMAL = 0x00000002,
        TBPF_ERROR = 0x00000004,
        TBPF_PAUSED = 0x00000008
    }

    public enum TaskbarProgressBarState
    {
        NoProgress = 0x00000000,
        Indeterminate = 0x00000001,
        Normal = 0x00000002,
        Error = 0x00000004,
        Paused = 0x00000008
    }

    [ComImportAttribute]
    [GuidAttribute("c43dc798-95d1-4bea-9030-bb99e2983a1a")]
    [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)]
    internal interface ITaskbarList3
    {
        [PreserveSig]
        void HrInit();
        [PreserveSig]
        void AddTab(IntPtr hwnd);
        [PreserveSig]
        void DeleteTab(IntPtr hwnd);
        [PreserveSig]
        void ActivateTab(IntPtr hwnd);
        [PreserveSig]
        void SetActiveAlt(IntPtr hwnd);

        [PreserveSig]
        void MarkFullscreenWindow(
            [In] IntPtr hwnd,
            [In, MarshalAs(UnmanagedType.Bool)] bool fullscreen);

        [PreserveSig]
        void SetProgressValue(IntPtr hwnd, UInt64 ullCompleted, UInt64 ullTotal);
        [PreserveSig]
        void SetProgressState(IntPtr hwnd, TBPFLAG tbpFlags);
    }

    [ComImportAttribute]
    [GuidAttribute("56FDF344-FD6D-11d0-958A-006097C9A090")]
    [ClassInterfaceAttribute(ClassInterfaceType.None)]
    internal class CTaskbarList { }
}
